import request from '@/utils/request'

// 获取员工列表
export function staffPageList(query) {
  return request({
    url: '/system/staff/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}

// 修改员工
export function updateStaff(data) {
  return request({
    url: '/system/staff',
    method: 'put',
    data: data,
    loading: true
  })
}

// 删除员工
export function delStaff(ids) {
  return request({
    url: '/system/staff/' + ids,
    method: 'delete',
    loading: true
  })
}

// 查询员工详情
export function getStaffDetailById(id) {
  return request({
    url: '/system/staff/' + id,
    method: 'get',
    loading: true
  })
}

// 获取员工战队列表
export function staffTeamPageList(query) {
  return request({
    url: '/system/staff/team/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}

// 添加员工战队
export function addStaffTeam(data) {
  return request({
    url: '/system/staff/team/add',
    method: 'post',
    data: data,
    loading: true
  })
}

// 删除员工战队
export function delStaffTeam(ids) {
  return request({
    url: '/system/staff/team/' + ids,
    method: 'delete',
    loading: true
  })
}

// 获取战队的员工列表
export function teamStaffPageList(query) {
  return request({
    url: '/system/staff/teamStaff/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}

// 移除战队员工
export function removeTeam(staffId,teamId) {
  return request({
    url: '/system/staff/team/' + staffId + '/' + teamId,
    method: 'delete',
    loading: true
  })
}

// 查询不存在于战队的员工列表（分页）
export function teamNoExistStaffPageList(query) {
  return request({
    url: '/system/staff/noExist/teamStaff/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}

// 添加员工到战队
export function addStaffToTeam(ids,teamId) {
  return request({
    url: '/system/staff/team/' + ids + '/' + teamId,
    method: 'post',
    loading: true
  })
}

// 获取是否拥有访问该活动权限的员工列表（分页）
export function isVisitStaffPageList(query) {
  return request({
    url: '/system/staff/isVisit/staff/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}

// 添加员工访问活动权限
export function addStaffVisitActivity(staffIds,activityId) {
  return request({
    url: '/system/staff/activity/' + staffIds + '/' + activityId,
    method: 'post',
    loading: true
  })
}

// 获取所有关联该活动的员工列表
export function relateActivityStaffList(activityId) {
  return request({
    url: '/system/staff/relateActivity/staffList/' + activityId,
    method: 'get',
    loading: true
  })
}

// 获取关联活动的战队列表
export function teamListByActivityId(activityId) {
  return request({
    url: '/system/staff/teamList/' + activityId,
    method: 'get',
    loading: true
  })
}

// 获取员工数据明细
export function staffDataDetailList(query) {
  return request({
    url: '/system/staff/staffDetailList/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}

// 获取员工排行榜
export function staffRankListByActivityId(query) {
  return request({
    url: '/system/staff/staffRankList/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}

// 获取战队统计
export function teamStatsListByActivityId(query) {
  return request({
    url: '/system/staff/teamStatsList/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}
